package com.ruoyi.apis.vo;

import com.ruoyi.apis.entity.IndustryEntity;
import com.ruoyi.apis.utils.ResponseUtils;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import lombok.Getter;
import lombok.Setter;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author Choi
 * @Date 2021/8/17
 */

@Getter
@Setter
public class IndustryVO {

    private Long id;
    private String name;
    private String image;
    private String[] time;

    public IndustryVO(IndustryEntity industryEntity) {
        BeanUtils.copyProperties(industryEntity, this);
//        this.setImage(ResponseUtils.getFulImage(industryEntity.getImage()));
        this.time = new String[]{"9:00-12:00", "12:00-12:30", "14:00-19:00"};
    }

    public static List<IndustryVO> getList(List<IndustryEntity> list) {
        return list.stream()
                .map(IndustryVO::new)
                .collect(Collectors.toList());
    }

}
